#include "MatchesToMat.h"

void MatchesToMat(cv::Mat *Src, cv::Mat *Dst, IpPairVec &matches)
{
    if(Src != NULL)
    {
      delete Src;
      delete Dst;
    }
      Src = new cv::Mat( matches.size( ), 2, CV_32F );
      Dst = new cv::Mat( matches.size( ), 2, CV_32F );

    for(int index = 0; index < matches.size(); index++ )
    {
      Src->at<float>( index, 0 ) = matches.at(index).first.x;
      Src->at<float>( index, 1 ) = matches.at(index).first.y;

      Dst->at<float>( index, 0 ) = matches.at(index).second.x;
      Dst->at<float>( index, 1 ) = matches.at(index).second.y;
    }
}
